Repository navigation
fix(quote): separate after-hours from the day's price; EXT extended-hours chart (depends on #43) - #52
Open
niravpatidar37 wants to merge 31 commits into
Open
niravpatidar37 wants to merge 31 commits into
niravpatidar37 wants to merge 31 commits into
Conversation
…ken), relay Retry-After, handle upstream errors
…uotes, macro, crypto)
…ula-shaped symbols)
Tile sizes came from market cap, which tracks the live price, so every 3s poll re-ran the treemap and every tile edge shifted. Freeze tile sizes and membership in a snapshot that polls only recolor, and re-take it on market switch or after 5 minutes.
…r, no per-poll rebuild)
Prompt chevron + rising candlesticks in the app's own amber/green/red. All assets generated by docs/brand/tools/build_brand.py (pinned, SHA-256 verified JetBrains Mono outlines; contrast and SVG-safety gates). Wires app/icon.svg, app/apple-icon.png, theme-color, a top-bar mark, and a light/dark README logo.
fitContent() stretched early-session 1D data (e.g. 13 five-minute bars at 10:30) across the whole panel, producing ~70 px candles. Reserve the full 9:30-16:00 session (78 slots) on 1D, and at least 60 slots elsewhere, so the chart fills in left to right like a normal terminal. Squash of fix/chart-bar-width (also proposed alone as ErTasselli#48).
…n price Outside regular hours Nasdaq's primaryData is the extended-hours trade, with its change measured from the 16:00 close; it was shown as the day's price and change (SPY after hours: -0.62% shown, the day was -0.37%). splitSessions() now uses the closed secondaryData as the regular price and returns the extended trade separately as quote.extended (Yahoo: pre/postMarket* fields). previousClose is derived from price - change, which matches the change shown. Also adds ext=1 on 1D history: 4:00-20:00 ET five-minute candles, with pre/post candles tagged via candle.session. Only the literal '1' on 1D enables it, so the cache key space stays bounded.
…uote panel 1D gets an EXT button: pre-market and after-hours candles drawn faded on a shaded background, with the full 4:00-20:00 day reserved. The quote panel shows the regular close as the main price plus a separate 'After hours' / 'Pre-market' line with change and time, with LEARN explanations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem: after hours, the quote showed the wrong day change
Outside regular hours, Nasdaq's
/infoprimaryDatais the pre-market or after-hours trade, and its change is measured from the 16:00 close.secondaryDataholds the regular close. The quote mappedprimaryDataas the day's price, so an after-hours move was labelled as the day's change.SPY at 19:56 ET, Oct 29:
The same mix-up fed today's live candle on 6M/1Y (it closed at the after-hours price) and the "day %" price alerts.
Changes
Server (
cfb1e5a)splitSessions(info)inproviders/nasdaq.ts: whensecondaryDatais a closed regular session, it becomesprice/change, and the extended trade becomesquote.extended = { session: "pre" | "post", price, change, changePercent, time }. During regular hours nothing changes.yahooExtended()maps Yahoo'spreMarket*/postMarket*fields the same way, for the fallback provider.previousCloseis derived fromprice − change, so it always matches the change shown.GET /api/history/:symbol?range=1D&ext=1returns 4:00–20:00 ET five-minute candles, and pre/post candles carrysession: "pre" | "post". Only the literal1on1Denables it, so the cache key space stays at two entries per symbol. Other ranges ignore it.Web (
dd52ef2)Verification
npm test: 190 tests / 23 files pass with--network none. That includes 9 new tests built from the real Nasdaq after-hours payload above: session split, pre-market labelling, a blank secondary price not read as a $0 close, junk input, the extended candle window and tags, and the Yahoo mapping.tscandnext buildare clean.docker compose up --buildafter hours (SPY, AAPL):ext=1returned 66 pre + 78 regular + 48 post candles, exactly the 192 five-minute slots from 4:00 to 20:00.ext=yes, andext=1on 6M, are ignored.ext=1, the pressed state, and no page errors. Security hardening + live data, alerts, Greeks, CSV, heatmap fixes, learning features (paper trading, tooltips, replay), logo #43's 14-check UI suite still passes.Notes
Security impact: one new query parameter, allowlisted to a single value on one range, with a bounded cache key. The new provider fields are parsed into numbers and a regex-matched time string, and rendered by React as text. No new outbound endpoints.